package com.example.demo.study;

public class Test5 {

    public static void main(String[] args) {
        String java = "你好";
        byte[] bytes = java.getBytes();
        for (byte aByte : bytes) {
            String binaryString = Integer.toBinaryString(aByte);
            System.out.print(binaryString + " ");
        }
        System.out.println();

        String binaryStr = "11111111111111111111111111100100 11111111111111111111111110111101 11111111111111111111111110100000 11111111111111111111111111100101 11111111111111111111111110100101 11111111111111111111111110111101";

        String[] split = binaryStr.split(" ");
        for (String s : split) {
            long i = Long.parseLong(s, 2);
            System.out.println((char) i);
        }
    }

}
